package com.cloudfun.campusshare.service;

import com.cloudfun.campusshare.common.constant.SysDictType;
import com.cloudfun.campusshare.common.response.BaseResult;
import com.cloudfun.campusshare.entity.SystemDictionaryEntity;

import java.util.Map;

/**
 * Created by Huqin on 2020/2/6
 */
public interface SysDictService {

    String CACHE_KEY = "SYSTEM_DICTIONARY";

    /**
     * 创建
     *
     * @param type
     * @param key
     * @param val
     * @return
     */
    BaseResult<?> create(SysDictType type, String key, String val);

    /**
     * 根据类型和key查询
     *
     * @param type
     * @param key
     * @return
     */
    SystemDictionaryEntity getByTypeAndKey(SysDictType type, String key);

    /**
     * 根据类型查询
     *
     * @param type
     * @return
     */
    Map<String, String> getDictByType(SysDictType type);

}
